Skip to content

Added decimal_isolate.py #3700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Oct 30, 2020
Merged

Added decimal_isolate.py #3700

merged 15 commits into from
Oct 30, 2020

Conversation

JakeGerber
Copy link
Contributor

Created a function program that isolates the decimal from a number.

  • [ X] Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • [X ] I have read CONTRIBUTING.md.
  • [ X] This pull request is all my own work -- I have not plagiarized.
  • [ X] I know that pull requests will not be merged if they fail the automated tests.
  • [X ] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [X ] All new Python files are placed inside an existing directory.
  • [ X] All filenames are in all lowercase characters with no spaces or dashes.
  • [X ] All functions and variable names follow Python naming conventions.
  • [ X] All function parameters and return values are annotated with Python type hints.
  • [ X] All functions have doctests that pass the automated testing.
  • [ X] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • [X ] If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@JakeGerber JakeGerber requested a review from Kush1101 as a code owner October 24, 2020 07:59
@amaank404
Copy link
Contributor

run this command on your pc:
pip install black
then run this:
black decimal_isolate.py
then upload the file changed by black

@JakeGerber
Copy link
Contributor Author

Thank you so much for the help!

@amaank404
Copy link
Contributor

Your Welcome!

@amaank404
Copy link
Contributor

@cclauss, check this out

@cclauss
Copy link
Member

cclauss commented Oct 25, 2020

@xcodz-dot You know how this works... Needs type hints as discussed in CONTRIBUTING.md.

@cclauss
Copy link
Member

cclauss commented Oct 25, 2020

Why not just use mod (num % 1) ?

@cclauss
Copy link
Member

cclauss commented Oct 25, 2020

Co-authored-by: Christian Clauss <[email protected]>
@JakeGerber
Copy link
Contributor Author

Why not just use mod (num % 1) ?

This does not work with negative numbers.

@JakeGerber JakeGerber changed the title Added decimal_isolate file. Added decimal_isolate.py Oct 26, 2020
@JakeGerber
Copy link
Contributor Author

Anything else?

@JakeGerber
Copy link
Contributor Author

@cclauss in case you missed it.

@cclauss
Copy link
Member

cclauss commented Oct 30, 2020

Why not just use mod (num % 1) ? Or https://docs.python.org/3/library/functions.html#divmod

@JakeGerber
Copy link
Contributor Author

Why not just use mod (num % 1) ? Or https://docs.python.org/3/library/functions.html#divmod

@cclauss once again moding does not work with negative numbers.

@cclauss
Copy link
Member

cclauss commented Oct 30, 2020

All doctests use positive numbers. Also, for completeness there should also be a test for zero.

#3700 (comment) Is not done.

@JakeGerber
Copy link
Contributor Author

@cclauss I updated the doctests

@cclauss cclauss added hacktoberfest hacktoberfest-accepted Accepted to be counted towards Hacktoberfest labels Oct 30, 2020
Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I learned about mod (%) and negative numbers.

@cclauss cclauss merged commit a538989 into TheAlgorithms:master Oct 30, 2020
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Add files via upload

* Delete decimal_isolate.py

* Added decimal_isolate file.

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Delete decimal_isolate.py

* Add files via upload

* Update maths/decimal_isolate.py

Co-authored-by: Christian Clauss <[email protected]>

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

Co-authored-by: Christian Clauss <[email protected]>
peRFectBeliever pushed a commit to peRFectBeliever/Python that referenced this pull request Apr 1, 2021
* Add files via upload

* Delete decimal_isolate.py

* Added decimal_isolate file.

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Delete decimal_isolate.py

* Add files via upload

* Update maths/decimal_isolate.py

Co-authored-by: Christian Clauss <[email protected]>

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

Co-authored-by: Christian Clauss <[email protected]>
Panquesito7 pushed a commit to Panquesito7/Python that referenced this pull request May 13, 2021
* Add files via upload

* Delete decimal_isolate.py

* Added decimal_isolate file.

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Delete decimal_isolate.py

* Add files via upload

* Update maths/decimal_isolate.py

Co-authored-by: Christian Clauss <[email protected]>

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

Co-authored-by: Christian Clauss <[email protected]>
shermanhui pushed a commit to shermanhui/Python that referenced this pull request Oct 22, 2021
* Add files via upload

* Delete decimal_isolate.py

* Added decimal_isolate file.

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Delete decimal_isolate.py

* Add files via upload

* Update maths/decimal_isolate.py

Co-authored-by: Christian Clauss <[email protected]>

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

Co-authored-by: Christian Clauss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest hacktoberfest-accepted Accepted to be counted towards Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants